#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Conexión 3G
# Copyright (C) 2009 Plan Ceibal
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Contact information: comunidad@plan.ceibal.edu.uy
# Plan Ceibal http://www.ceibal.edu.uy


import gtk
import os, sys
import logging
import SetConfiguracion
import gtk.glade
import InterfazGlade
from sugar.activity import activity  

class Conexion3G(activity.Activity):
	def __init__(self, handle):
		activity.Activity.__init__(self, handle)
		self._name = handle
		# Titulo
		self.set_title('Conexión Módem 3G')
		# ToolBox
		toolbox = activity.ActivityToolbox(self)
		self.set_toolbox(toolbox)
		toolbox.show()
		# Main container
		self._main_view = gtk.VBox()
		self.interfazGlade = InterfazGlade.InterfazGlade()

		self._main_view.pack_start(self.interfazGlade.connectionwindow)
		self._main_view.pack_start(self.interfazGlade.setupwindow)

		self.interfazGlade.btnsetup.connect('clicked', self.on_setup)
		self.interfazGlade.btnsetupclose.connect('clicked', self.on_setup_close)
		# Mostrar Todo
		self._main_view.show()
		self.set_canvas(self._main_view)
		self.show_all()
		self.interfazGlade.setupwindow.hide()
		self.interfazGlade.progressbar.hide()

	def on_setup(self, *args):
		self.interfazGlade.connectionwindow.hide()
		self.interfazGlade.setupwindow.show()

	def on_setup_close(self, *args):
		self.interfazGlade.connectionwindow.show()
		self.interfazGlade.setupwindow.hide()


